package com.matrix.java.chap_07.exercise;

public class EX7_17 {
    /*public static void main(String[] args) {
        int number = 0;
        int[] numcers = new int[1];
        m(number,numcers);
        System.out.println("number is "+number+" and number[0] is "+numcers[0]);
    }

    private static void m(int x, int[] y) {
        x=3;
        y[0] =3;
    }*/
    public static void main(String[] args) {
        int[] list ={1,2,3,4,5};
        reverse(list);
        for (int i = 0; i < list.length; i++) {
            System.out.println(list[i]+"\t");
        }
    }

    private static void reverse(int[] list) {
        int[] newList = new int[list.length];
        for (int i = 0; i < list.length; i++) {
            newList[i] = list[list.length-1-i];
        }
        list = newList;
    }

}
